<template>
	<view>
		<view class="a" @tap='select(item.id)' v-for="item in list1">
			<view class="a1">{{item.name}}</view>
			<view class="a2">地址{{item.provinceStr}}{{item.cityStr}}{{item.areaStr}}</view>
			<view class="a3">电话{{item.tel}}</view>
			<view class="a4" @tap='xg(item.id)'>| 编辑</view>
		</view>
	</view>
</template>

<script>
	import {list} from "../../../util/user/user.js"
	export default{
		data(){
			return{
				list1:[]
			}
		},
		methods:{
			xg(val){
				uni.navigateTo({
					url:`./xg?id=${val}`
				})
			},
			select(val1){
				uni.navigateTo({
					url:`/pages/user/cardlist/pay/pay?id=${val1}`
				})
			}
		},
		onLoad(){
			list({
				userId:uni.getStorageSync('userInfo').id
			})
			.then(res=>{
				console.log(res)
				this.list1 = res.data.data
			})
		}
		
	}
</script>

<style>
	.a{
		position: relative;
		width: 650rpx;
		height: 200rpx;
		border-radius: 5px;
		background-color: white;
		margin: 50rpx auto;
	}
	.a1{
		position: absolute;
		top: 20rpx;
		left: 100rpx;
		font-size: 15px;
		font-weight: 900;
	}
	.a2{
		position: absolute;
		top: 60rpx;
		left: 100rpx;
		color: grey;
	}
	.a3{
		position: absolute;
		top: 100rpx;
		left: 100rpx;
		color: grey;
	}
	.a4{
		position: absolute;
		top: 60rpx;
		left: 500rpx;
		color: grey;
	}
</style>
